public class Test {
    public static void main(String[] args) {
        student[] students = new student[3];
        students[0] = new Undergraduate("张三");
        students[1] = new Undergraduate("李四");
        students[2] = new Postgradeate("王五");
        int[] score = {70, 80, 90};
        for (int i = 0; i < 3; i++) {
            students[i].courses = score;
        }
        for (int i = 0; i < 3; i++) {
            students[i].caculateGrade();
        }
        for (int i = 0; i < 3; i++) {
            System.out.println(students[i]);
        }
    }
}
